<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get('/', function () use ($app) {
    return $app->version();
});
$app->get('/aa','testControllers@aa');

$app->group(['prefix' => 'user'], function ()use($app){
    $app->post('getToken', 'UserController@getToken');
    $app->get('login', [
        'middleware' => 'authToken',
        'uses' => 'UserController@login'
    ]);
    $app->post('checkUser', 'UserController@checkUser');
    $app->post('create', 'UserController@create');
    $app->post('getUserList', 'UserController@getUserList');
    $app->get('getUser', 'UserController@getUser');
    $app->put('updatePwd', 'UserController@updatePwd');
    $app->put('updateUser', 'UserController@updateUser');
    $app->delete('delUser', 'UserController@delUser');
});
$app->group(['prefix' => 'member'], function ()use($app){
    $app->post('getToken', 'MemberController@getToken');
    $app->get('login', [
        'middleware' => 'authToken',
        'uses' => 'MemberController@login'
    ]);
    $app->post('getMemberList', 'MemberController@getMemberList');
    $app->post('register', 'MemberController@register');
    $app->delete('del', 'MemberController@del');
    $app->post('insertMember','MemberController@insertMember');
    $app->post('checkPhone','MemberController@checkPhone');
    $app->post('sendSmsCode','MemberController@sendSmsCode');
    $app->post('getsmscode','MemberController@getsmscode');
    $app->put('updatePwd','MemberController@updatePwd');
    $app->put('updateInfo','MemberController@updateInfo');
    $app->put('updatePic','MemberController@updatePic');
});
$app->group(['prefix' => 'article'], function ()use($app){
    $app->post('getArticleList', 'ArticleController@getArticleList');
    $app->post('createArticle', 'ArticleController@createArticle');
    $app->delete('del', 'ArticleController@deleteArticle');
    $app->post('getarticle','ArticleController@getarticle');
    $app->put('updateArticle','ArticleController@updateArticle');
    $app->get('getzdList','ArticleController@getzdList');
    $app->post('isup','ArticleController@isup');
});
$app->group(['prefix' => 'tutor'], function ()use($app){
    $app->post('getTutorList', 'TutorController@getTutorList');
    $app->post('createTutor', 'TutorController@createTutor');
    $app->put('updateTutor', 'TutorController@updateTutor');
    $app->delete('delTutor', 'TutorController@delTutor');
    $app->get('getWebTutorList', 'TutorController@getWebTutorList');

});

//文件服务器
$app->group(['prefix' => 'file'], function () use ($app) {
    $app->post('upload','FileController@upload');
    $app->get('getFile','FileController@getFile');
    $app->get('download','FileController@download');
    $app->get('delete','FileController@delete');
    $app->get('getPath','FileController@getPath');
//    $app->post('/upCarLogo', 'CarLogoController@upload');
//    $app->get('/getCarLogo', 'CarLogoController@getFile');
    $app->post('/carLogoUpload', 'FileController@carLogoUpload');
    $app->get('/carLogoGet', 'FileController@getCarLogo');
});



